package com.fmdrama.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.zip.GZIPInputStream;


public class GZIPUtil {
	public static String decode(InputStream is, String charset) throws IOException{
		 GZIPInputStream gzip = new GZIPInputStream(is);
		 InputStreamReader reader = new InputStreamReader(gzip, charset);
		 BufferedReader br = new BufferedReader(reader);  
         StringBuffer sb = new StringBuffer();  
         String line = null;  
         while ((line = br.readLine()) != null) {  
             sb.append(line);  
             sb.append("\n");  
         }  
         reader.close();  
         gzip.close();  
         return sb.toString();  
	}
}
